package com.baizan.daka.widget

import android.content.Context
import android.util.AttributeSet
import android.view.View
import com.baizan.daka.base.BaseLayoutView
import com.dianzan.daka.R
import kotlinx.android.synthetic.main.base_empty_error_data.view.*

class ListEmptyErrorView : BaseLayoutView {
    var isEmptyStatus = true


    fun setEmptyStatusing() {
        if (!isEmptyStatus) {
            isEmptyStatus = true
            empty_view?.setVisibility(View.VISIBLE)
            error_img?.setVisibility(View.GONE)
        }
    }
    fun setErrorStatusing() {
        if (isEmptyStatus) {
            isEmptyStatus = false
            empty_view?.setVisibility(View.GONE)
            error_img?.setVisibility(View.VISIBLE)
        }
    }
    constructor(context: Context) : super(context)
    constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
    constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    )

    override fun initLayout(): Int = R.layout.base_empty_error_data
}